/*
 * @Descripttion: 
 * @Author: liuYaoYu
 * @Date: 2021-12-17 17:03:18
 * @LastEditors: liuYaoYu
 * @LastEditTime: 2021-12-17 17:48:41
 */
package main
import (
	"fmt"
)
func BubbleSort(arr *[]int){
	temp:=0
	for i:=0;i<len(*arr)-1;i++{
		for j:=0;j<len(*arr)-i-1;j++{
			if (*arr)[j]>(*arr)[j+1]{
				temp=(*arr)[j]
				(*arr)[j]=(*arr)[j+1]
				(*arr)[j+1]=temp
			}
		}
	}
	fmt.Println(*arr)
}
func main(){
	var strs =[]int{324,32,4,32,44,123,213,21,312,321,321,3321}// 这是个切片
	BubbleSort(&strs)
	var arr=[...]int{1,2,3,4,5};// 这是数组
	var slice = []int{1,23,4,5,6,7,8,7}// 这是切片
	fmt.Printf("arr的type=%T,slice的type=%T",arr,slice)
}